<div class="container">

    <?php echo $this->element('page_header'); ?>

    <div class="row">
        <div class="span4">
            <div class="widget">

                <div class="widget-header">
                    <h3>
                        <i class="icon-th-list"></i>
                        Current Profile Information
                    </h3>
                </div> <!-- /widget-header -->

                <div class="widget-content">
                    <div class="pricing-plans plans-1">
                        <div class="plan-container">
                            <div class="plan">
                                <div class="plan-header">

                                    <div class="plan-title">
                                        <?php
                                            echo $authUser['fname'].' '.$authUser['mname'].' '.$authUser['lname'];
                                        ?>
                                    </div> <!-- /plan-title -->

                                    <div class="plan-price" style="font-size: 36px;">
                                        <span class="note"></span><?php  echo $authUser['username'] ;?><span class="term"><?php  echo $user_info['Group']['name'] ;?></span>
                                    </div> <!-- /plan-price -->

                                </div> <!-- /plan-header -->

                                <div class="plan-features">
                                    <ul>
                                        <li><strong>Branch:</strong>&nbsp;&nbsp;&nbsp;&nbsp;<?php  echo $user_info['Branch']['name'] ;?></li>
                                        <li><strong>Department:</strong>&nbsp;&nbsp;&nbsp;&nbsp;<?php  echo $user_info['Department']['name'] ;?></li>
                                        <!--<li><strong>Assigned Projects:</strong>&nbsp;&nbsp;
                                            <?php
/*                                                foreach($user_info['Project'] as $pro){
                                                    echo $pro['name'].' | ';
                                                }
                                            */?>
                                        </li>-->
                                    </ul>
                                </div> <!-- /plan-features -->

                                <div class="plan-actions">
                                    <!--<a href="javascript:;" class="btn">Purchase Now</a>-->
                                </div> <!-- /plan-actions -->

                            </div> <!-- /plan -->
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="span8">

            <div class="widget">

                <div class="widget-header">
                    <h3>
                        <i class="icon-th-list"></i>
                        Update Profile Info
                    </h3>
                </div> <!-- /widget-header -->

                <div class="widget-content">
                    <?php
                    $error = false;
                    if($this->Session->check('process_error')){
                        if($this->Session->read('process_error') == 'yes'){
                            $error = true;
                        }
                        $controller->Session->delete('process_error');
                    }
                    ?>
                    <?php
                    $flash_msg = $this->Session->read('Message');
                    if(isset($flash_msg['flash'])){
                        ?>
                        <div class="row-fluid">
                            <div class="span12">
                                <?php
                                if($error){
                                    echo $this->Message->msg('Status',$this->Session->flash(),'error',true);
                                }
                                else{
                                    echo $this->Message->msg('Status',$this->Session->flash(),'success',true);
                                }
                                ?>
                            </div>
                        </div>
                    <?php
                    }
                    ?>
                    <?php echo $this->Form->create('User', array('id' => 'form','class'=>'form-horizontal'));?>
                        <fieldset>
                            <div class="control-group">
                                <label class="control-label" for="fname">First Name</label>
                                <div class="controls">
                                    <?php echo $this->Form->input('fname', array('id' => 'fname', 'required' => 'required', 'value' => $authUser['fname'], 'div' => false, 'label' => false)); ?>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="mname">Middle Name</label>
                                <div class="controls">
                                    <?php echo $this->Form->input('mname', array('id' => 'mname', 'class' => '', 'value' => $authUser['mname'], 'div' => false, 'label' => false)); ?>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="lname">Last Name</label>
                                <div class="controls">
                                    <?php echo $this->Form->input('lname', array('id' => 'lname','required' => 'required', 'value' => $authUser['lname'], 'div' => false, 'label' => false)); ?>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="lname">Username</label>
                                <div class="controls">
                                    <?php echo $this->Form->input('username', array('id' => 'username', 'required' => 'required', 'value' => $authUser['username'], 'div' => false, 'label' => false)); ?>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="lname">Password</label>
                                <div class="controls">
                                    <?php echo $this->Form->input('password', array('id' => 'password', 'type' => 'password', 'class' => '', 'div' => false, 'label' => false)); ?>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="lname">Email</label>
                                <div class="controls">
                                    <?php echo $this->Form->input('email', array('id' => 'email', 'required' => 'required', 'default' => $authUser['email'], 'div' => false, 'label' => false)); ?>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="lname">Telephone</label>
                                <div class="controls">
                                    <?php echo $this->Form->input('fon_number', array('id'=>'telephone', 'required' => 'required' ,'value'=>$authUser['fon_number'], 'div' => false, 'label' => false)); ?>
                                </div>
                            </div>
                            <div class="form-actions">
                                <button type="submit" class="btn btn-primary btn-large">Save changes</button>
                                <button type="reset" class="btn btn-large">Cancel</button>
                                <?php echo $this->Form->input('id', array('type'=>'hidden','id'=>'id', 'value'=>$authUser['id'], 'div' => false, 'label' => false)); ?>
                            </div>
                        </fieldset>
                    <?php echo $this->Form->end();?>
                </div> <!-- /widget-content -->

            </div> <!-- /widget -->

        </div>

    </div> <!-- /.row -->

</div> <!-- /.container -->

<!-- URLs -->
<input type="hidden" id="table-url" value="<?php echo $this->Html->url(array('controller' => 'Admin', 'action' => 'index/get')); ?>" />
<input type="hidden" id="table-editable-url" value="<?php echo $this->Html->url(array('controller' => 'Admin', 'action' => 'index/save')); ?>" />
<input type="hidden" id="table_delete_url" value="<?php echo $this->Html->url(array('controller' => 'Admin', 'action' => 'index/delete')); ?>" />


<?php
    //echo $this->Html->script('Scripts/admin/company.js');
?>